
var HistoryController = function($scope, $http){
	$http.defaults.headers.post["Content-Type"] = "application/json";
	var urlBase="http://localhost:8080/finalproject";
	
	$scope.getListHistory = function(){
		$scope.resetError();
		$http.get(urlBase + '/history/getlist').success(function(respone){
			$scope.listHistory = respone;
		}).error(function(){
			$scope.setError("Can't get list history");
		});
	}
	
	 $scope.setError = function(message){
         $scope.error = true;
         $scope.errorMessage = message;
	 }
	 
	 $scope.resetError = function(){
	         $scope.error = false;
	         $scope.errorMessage = '';
	 }
	 
	 $scope.getListHistory();
}